<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="Shop.damain.Goods" %>
<%@ page contentType="text/html;utf-8" pageEncoding="utf-8" %>
<html>
<head>
    <title>Title</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

<ul class="nav nav-pills nav-justified" role="tablist">
    <li role="presentation" class="active"><a href="#">Home</a></li>
    <li role="presentation"><a href="register.jsp">Profile</a></li>
    <li role="presentation"><a href="#">Messages</a></li>
</ul>
<form name="sg" action="ShowGoods.do" method="post" >
<%--    <input type="text" id="productname" name="pname" placeholder="请输入查询产品名称">
    <input type="submit" value="查询">--%>
    <div class="row">
       <div class="col-lg-12" >
            <div class="input-group">
                <input type="text" id="gname" name="gname" class="form-control">
                <span class="input-group-btn">
        <button class="btn btn-default"  type="submit">查询</button>
      </span>
            </div><!-- /input-group -->
        </div><!-- /.col-lg-6 -->
    </div><!-- /.row -->
</form>
<table border="1" class="table table-condensed">
    <tr>
        <td>产品编码</td>
        <td>产品名称</td>
        <td>产品价格</td>
        <td>操作</td>
    </tr>
        <%

            //获取共享对象
            List<Goods> data = (ArrayList)session.getAttribute("mygoods");
            for (Goods g : data) {
        %>
        <tr>
            <td><%= g.getGpid()%></td>
            <td><%= g.getGname()%></td>
            <td><%= g.getGprice()%></td>
            <td><a href="">添加</a></td>
        </tr>
        <%
            }
        %>`
</table>
<nav>
    <ul class="pager">
        <li><a href="ShowGoods.do?flag=0">Previous</a></li>
        <li><a href="ShowGoods.do?flag=1">Next</a></li>
    </ul>
</nav>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
